﻿@{
    ViewBag.Title = "枚举项列表";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
@(       
 Html.DWZGridFor<EnumItem>()
    .Action(@Url.Action("EnumItemList"))
    .Height("document.documentElement.clientHeight-87")
    .ExtParam(new { ParentId = @ViewBag.ParentId })
    .Columns(col =>
    {
        col.Bind(e => e.Id).IsKey();
        col.Bind(e => e.EnumCode).Width(80).AsQuery();
        col.Bind(e => e.EnumName).Width(100).AsQuery();
        col.Bind(e => e.Remark).Width(200);
        col.Bind(e => e.SeqNo).Width(50);
        col.Bind(e => e.Id, "操作", 220).Sortable(false)
            .Template(Url.EditLink("EditEnumItem", "编辑枚举项")
            + Url.DeleteLink("DeleteEnumItem", "${EnumName}")
            + Url.GridLink("setuser", "查看子枚举", "ViewSubItem('${Id}','${EnumName}')"));
    })
    .Buttons(btn =>
    {
        btn.Bind("Add", "新建枚举", FlexiGridButtonType.Add).Action(@Url.Action("EditEnumItem", new { ParentId = @ViewBag.ParentId })).OnPress("OpenFormDailog");
    })
)
@Html.Css("dailog")
@Html.Js("dailog")
<script type="text/javascript">
    // 查看子枚举
    function ViewSubItem(Id, name) {
        OpenModelWindow('@Url.Action("ViewSubEnumItem")?parentId=' + Id, { width: 800, height: 530, caption: "子枚举列表（" + name + "）" });
    }
</script>
